﻿<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Img Change Demo 淡入淡出</title>
		<style type="text/css">
			body{
				margin: 0;
			}

			.hide{
				display: none;
			}

			#box img{
				height: 100%;
			}

			#box div{
				position: absolute;
				height: 100%;
				width: 100%;
			}

			#box{
				position: absolute;
				width: 100px;
				height: 100px;
				border-radius: 50px;
				overflow: hidden;
				cursor: pointer;
			}
		</style>
		<script type="text/javascript" src="../static/js/lib/jquery-1.7.1.min.js"></script>
		<script type="text/javascript">
			$(document).ready(function(){
				var nowImg = 1;
				$("#box").bind("click", function(){
					$("#img"+nowImg).fadeOut(1000);//1000毫秒
					nowImg++;
					if(nowImg > 2){
						nowImg = 1;
					}
					$("#img"+nowImg).fadeIn(1000);
				});
			});
		</script>
	</head>
	<body>
		<div id="box">
			<div id="img1">
				<img src="../static/img/img_2_2.jpg">
			</div>
			<div id="img2" class="hide">
				<img src="../static/img/img_2_3.jpg">
			</div>
		</div>
	</body>
</html>